package com.company.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 广告实体
 * Created by tu on 2017/7/11.
 */
@Entity
@Table(name = "banners")
public class Banner implements Serializable {

  private static final long serialVersionUID = -743838926608390082L;
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  private Long id;
  @Column(name = "sort")
  private int sort;

  @Column(name = "url")
  private String url;

  @Column(name = "source_url")
  private String sourceUrl;

  @Column(name = "title")
  private String title;

  @Column(name = "description")
  private String description;

  @Column(name = "create_time")
  private Date createTime;

  @Column(name = "update_time")
  @JsonIgnore
  private Date updateTime;

  @Column(name = "is_delete")
  @JsonIgnore
  private int deleted;

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public int getSort() {
    return sort;
  }

  public void setSort(int sort) {
    this.sort = sort;
  }

  public String getUrl() {
    return url;
  }

  public void setUrl(String url) {
    this.url = url;
  }

  public String getSourceUrl() {
    return sourceUrl;
  }

  public void setSourceUrl(String sourceUrl) {
    this.sourceUrl = sourceUrl;
  }

  public String getTitle() {
    return title;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public Date getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Date createTime) {
    this.createTime = createTime;
  }

  public Date getUpdateTime() {
    return updateTime;
  }

  public void setUpdateTime(Date updateTime) {
    this.updateTime = updateTime;
  }

  public int getDeleted() {
    return deleted;
  }

  public void setDeleted(int deleted) {
    this.deleted = deleted;
  }

  @Override
  public String toString() {
    return "Banner{" +
        "id=" + id +
        ", sort=" + sort +
        ", url='" + url + '\'' +
        ", sourceUrl='" + sourceUrl + '\'' +
        ", title='" + title + '\'' +
        ", description='" + description + '\'' +
        ", createTime=" + createTime +
        ", updateTime=" + updateTime +
        ", deleted=" + deleted +
        '}';
  }
}